import axios from 'axios'
import React, { useState } from 'react'
import PubSub from 'pubsub-js'
export default function Header() {
    const [searchUser,setSearchUser] = useState('')
    const getMsghandle = async ()=>{
       const msg =await axios.get('https://api.github.com/search/users?q=xxxxxx')
       const [items] = msg.data
       setSearchUser(items)
    }
    const changeMsghandle= (e)=>{ 
        const result = e.target.value
    }

    return (
        <div>
            <section className="jumbotron">
                <h3 className="jumbotron-heading">Search Github Users</h3>
                <div>
                    <input type="text" placeholder="enter the name you search" value=''  onChange={changeMsghandle}/>&nbsp;<button  onClick={getMsghandle}>Search</button>
                </div>
            </section>
        </div>
    )
}
